Skip to content

Publish to PyPI on release #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 5, 2023
Merged

Publish to PyPI on release #16

merged 5 commits into from
Jun 5, 2023

Conversation

bbayles
Copy link
Collaborator

@bbayles bbayles commented Jun 5, 2023

Re: Issue #15, this PR updates the build.yml file such that:

  • The action runs when a new GitHub release is created
  • A source distribution (.tar.gz) is created
  • The source distribution and binary distributions (.whl) are uploaded to PyPI

I am drawing from these docs:

I have created a GitHub "environment" called release for publishing. I will configure PyPI to use it as well.

@bbayles bbayles linked an issue Jun 5, 2023 that may be closed by this pull request
Comment on lines +16 to +18
release:
types:
- published
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for the new upload_all job below, which has:

if: github.event_name == 'release' && github.event.action == 'published'

@@ -21,20 +25,38 @@ jobs:
build_wheels:
strategy:
matrix:
os: ["ubuntu-20.04", "macos-11"]
os: ["ubuntu-latest", "macos-latest"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cibuildwheel should take care of the compatibility for older platforms

@anonrig
Copy link
Member

anonrig commented Jun 5, 2023

Do we need to pass any secrets to Github for Pypi?

@bbayles
Copy link
Collaborator Author

bbayles commented Jun 5, 2023

Per this document, no - notice how the secrets section is removed.
image

@anonrig
Copy link
Member

anonrig commented Jun 5, 2023

Nice. Let's merge and try publishing...

@bbayles bbayles merged commit 427e967 into main Jun 5, 2023
@bbayles bbayles deleted the pypi-release-action branch June 5, 2023 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Releases
2 participants